<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>
		<script src="layui/layui.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<form class="layui-form" action="">
		  <div class="layui-form-item">
		    <label class="layui-form-label">商品名称</label>
		    <div class="layui-input-inline">
		      <input type="text" name="title" required  lay-verify="required" placeholder="请输入商品名称" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">商品价格</label>
		    <div class="layui-input-inline" style="width: 100px;">
			  <input type="text" name="price_min" placeholder="￥" autocomplete="off" class="layui-input">
			</div>
			<div class="layui-form-mid">-</div>
			<div class="layui-input-inline" style="width: 100px;">
			  <input type="text" name="price_max" placeholder="￥" autocomplete="off" class="layui-input">
			</div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">上架时间</label>
		    <div class="layui-input-inline" style="width: 200px;">
		      <input type="text" id="time_min" name="time_min" placeholder="开始时间" autocomplete="off" class="layui-input">
		    </div>
		    <div class="layui-form-mid">-</div>
		    <div class="layui-input-inline" style="width: 200px;">
		      <input type="text" id="time_max" name="time_max" placeholder="结束时间" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">商品分类</label>
		    <div class="layui-input-inline">
		      <select name="city" lay-verify="required">
		        <option value=""></option>
		        <option value="0">上衣</option>
		        <option value="1">裤子</option>
		        <option value="2">鞋子</option>
		      </select>
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">商品尺寸</label>
		    <div class="layui-input-block">
		      <input type="checkbox" name="like[write]" title="L">
		      <input type="checkbox" name="like[read]" title="M" checked>
		      <input type="checkbox" name="like[dai]" title="S">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">是否上架</label>
		    <div class="layui-input-block">
		      <input type="checkbox" name="switch" lay-skin="switch" lay-text="上架|下架" checked>
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <div class="layui-input-block">
		      <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
		      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
		    </div>
		  </div>
		</form>
		 
		<script>
		//Demo
		layui.use('form', function(){
		  var form = layui.form;
		  
		  //监听提交
		  form.on('submit(formDemo)', function(data){
		    layer.msg(JSON.stringify(data.field));
		    return false;
		  });
		});
		</script>
		
		<script>
		layui.use('laydate', function(){
		  var laydate = layui.laydate;
		  
		  //执行一个laydate实例
		  laydate.render({
		    elem: '#time_min' //指定元素
		  });
		  laydate.render({
		    elem: '#time_max' //指定元素
		  });
		});
		</script>
	</body>
</html>
